function svmMontage ( annotations, disp_flags, hog_flag)

load_settings;
colormap jet;

imgs = [];
mi = 1;
for ix = 1:length(disp_flags)
    if disp_flags(ix)
		% keyboard
%         filename = regexprep(annotations(ix).image, '../AMOS_Data', '../trunk/AMOS_Data');
        filename = annotations(ix).image;
        img = imread(filename);
        x = annotations(ix).rect(1);
        y = annotations(ix).rect(2);
        xx= annotations(ix).rect(3);
        yy= annotations(ix).rect(4);
        if hog_flag
            tt = vl_hog('render', vl_hog(single(imresize(img(y:y+yy, x:x+xx, :), reshape_size)), binsize));
        else
            tt = double(imresize(img(y:y+yy, x:x+xx, :), reshape_size));
            tt = tt./max(tt(:));
        end
        imgs(:,:,:,mi) = tt;
        mi = mi+1;
    end
end

if isempty(imgs)
    disp('No images to display');
else
    handles = imdisp(imgs, 'Size', montage_dims, 'Border', [ montage_border montage_border ]);
end
end